<template>
<div id="app">
    <hr style="border: none"/>
    <div>
        <el-form :inline="true" :model="queryForm.data" class="demo-form-inline">
            <el-form-item>
                 <el-college-option @showCollegeName="updateCollege"></el-college-option>
            </el-form-item>
            <el-form-item>
                <el-date-picker
                        v-model="queryForm.data.year"
                        type="year"
                        placeholder="选择年份"
                        value-format="yyyy">
                </el-date-picker>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="loadEcharts" icon="el-icon-search">查询</el-button>
            </el-form-item>
        </el-form>
    </div>
    <div align="center">
        <span style="font-family: 微软雅黑;font-size: 20px;">潍坊学院{{collegeName}}{{queryForm.data.year}}年度</span>
        <br/>
        <span style="font-size: 18px">学生就业情况</span>
    </div>
    <hr>

    <div style="height:2800px;">
        <el-row :gutter="10">
            <el-col :span="6" style="width: 100%;">
                <el-card :body-style="{ padding: '0px',height: '80%' }">
                    <div slot="header" class="clearfix">
                        <span>横向对比-学院对比</span>
                    </div>
                    <college-employ-compare v-bind:year="this.queryForm.data.year" class="echarts"></college-employ-compare>
                </el-card>
            </el-col>
        </el-row>
        <el-row :gutter="10">
            <el-col :span="6" style="width: 100%;">
                <el-card :body-style="{ padding: '0px',height: '80%' }">
                    <div slot="header" class="clearfix">
                        <span>横向对比-专业对比</span>
                    </div>
                    <major-employ-compare v-bind:year="this.queryForm.data.year"
                        v-bind:collegeCode="this.queryForm.data.collegeCode"
                        class="echarts"></major-employ-compare>
                </el-card>
            </el-col>
        </el-row>
    </div>
  </div>
</template>

<script>
import CollegeEmplyCompare from './college-compare.vue'
import MajorEmplyCompare from './major-compare.vue'
import SchoolEmployTrend from './school-employ-trend.vue'
import CollegeEmployTrend from './college-employ-trend.vue'
import MajorEmployTrend from './major-employ-trend.vue'

export default {
  name: 'Total',
  components: {
    'college-employ-compare': CollegeEmplyCompare,
    'major-employ-compare': MajorEmplyCompare,
    'school-employ-trend': SchoolEmployTrend,
    'college-employ-trend': CollegeEmployTrend,
    'major-employ-trend': MajorEmployTrend
  },
  data () {
    return {
      url: {
        collegeOptions: '/datacenter/college/query/spinner'
      },
      collegeName: '', // 方便在页面回显学院名称
      queryForm: {
        dialogFormVisible: false,
        data: {
          collegeCode: '',
          // 年份，默认选中当前年份
          year: new Date().getFullYear().toString()
        }
      }
    }
  },
  methods: {
    updateCollege: function (data) {
      this.queryForm.data.collegeCode = data.id
      this.collegeName = data.text
    }
  }
}
</script>
<style>
.el-card {
  height: 100%;
}

.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}

/* .el-row {
  width: 100%;
  height: 18%;
  margin-bottom: 10px;
} */

.el-col {
  width: 50%;
  height: 100%;
}

.echarts {
  width: 100%;
  height: 100%;
}
</style>
